package cn.com.nes.site.controller.crm.saleorder.vo;

import cn.com.nes.site.entity.em.crm.saleorder.SaleOrderStatusEnum;
import cn.com.nes.site.entity.vo.BaseVO;
import cn.com.nes.site.service.crm.order.bo.SaleOrderBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotNull;

@ApiModel(value = "销售订单支付成功入参模型")
@Data
public class SaleOrderPaymentSuccessVO extends BaseVO {

    @ApiModelProperty(value = "销售订单ID", required = true)
    @NotNull(message = "销售订单ID")
    private Long saleOrderId;


    public SaleOrderBO convertToBo() {
        SaleOrderBO saleOrderBo = new SaleOrderBO();
        BeanUtils.copyProperties(this, saleOrderBo);
        saleOrderBo.setSaleOrderStatus(SaleOrderStatusEnum.PAID_SUCCESS);
        return saleOrderBo;
    }

}
